package com.gzy.network.Interceptor;

import com.gzy.network.utils.KLog;
import java.io.IOException;
import okhttp3.Interceptor;
import okhttp3.Response;

/**
 * @author : guzy
 * @program: net-app
 * @description: 返回拦截器（响应拦截器）
 * @date : 2022-03-24 12:03
 **/
public class ResponseInterceptor implements Interceptor {

  private static final String TAG = "ResponseInterceptor";

  /**
   * 拦截
   */
  @Override
  public Response intercept(Chain chain) throws IOException {
    long requestTime = System.currentTimeMillis();
    Response response = chain.proceed(chain.request());
    KLog.i(TAG, "requestSpendTime=" + (System.currentTimeMillis() - requestTime) + "ms");
    return response;
  }
}